package ve.com.wayoyo.wuml_case.DibujoDiagramas;

import java.util.ArrayList;

import ve.com.wayoyo.wuml_case.R;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;

public class SeleccionarMetodoComponente extends Dialog{

	private LinearLayout _metodo;
	private ArrayList<CompMetodo> _listaComponente = new ArrayList<CompMetodo>();
	private ArrayList<String> _valuesList;
	private ArrayAdapter<String> _dataAdapter;
	
	public SeleccionarMetodoComponente(Context context,ArrayAdapter<String> dataAdapter) {
		super(context);		
//		_listaComponente = ((CompClase)VistaDiagrama.getVista().getDiagrama().getSelectedItem()).get_metodos();
		this._dataAdapter = dataAdapter;
	}
	
	@Override
	public void onCreate(Bundle savedInstanceState) {	
		super.onCreate(savedInstanceState);
		setContentView(R.layout.seleccion_metodo_layout);
		setTitle("Seleccione el Metodo a Modificar");
		_metodo = (LinearLayout) findViewById(R.id.seleccionMetodosLayout);
		_metodo.removeAllViewsInLayout();
		ListView vistaListaAtributo = new ListView(getContext());

		vistaListaAtributo.setAdapter(_dataAdapter);
		
		vistaListaAtributo.setOnItemClickListener(new OnItemClickListener() {
			public void onItemClick(AdapterView<?> parent, View view,
					int position, long id) {			
				SeleccionarMetodoComponente.this.dismiss();
				ModificarMetodoComponente myDialog = new ModificarMetodoComponente(getContext(),position);
				myDialog.show();				
			}
		});
		
		_metodo.addView(vistaListaAtributo);
		
		
		
	}

}
